package com.ymttest.database.sqlwapper;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ymt.core.tool.Logger;
import com.ymt.database.SqlManager;

/************************************************************************************
 * @File name : YmtUserWapper.java
 * @Author : zhouyi
 * @Date : 2015年4月2日
 * @Copyright : 洋码头
 ************************************************************************************/
public class SupplyChinaShipRouteWapper {
	SqlManager manage;

	public SupplyChinaShipRouteWapper() {
		manage = new SqlManager("xlobosit1");
	}

	//根据供应商id查询
	public List<Map> selectbySupplyId (int SupplyId)throws InterruptedException{
		@SuppressWarnings("unchecked")
		List <Map> SupplyIdList=manage.getSelectResults(
				"com.ymttest.database.mapping.SupplyChinaShipRouteMapper.selectbySupplyId", SupplyId);
    	manage.commit();
		return SupplyIdList;
	}

	/**
	 * 根据省市地区查询供应商
	 * @param provinceName 省
	 * @param CityName 市
	 * @param RegionName 地区
	 * @return
	 * @throws InterruptedException
	 */
	public List<Map> selectbyProvince (String provinceName , String CityName ,String RegionName)throws InterruptedException{
		@SuppressWarnings("unchecked")
		
		Map<String, String> map = new HashMap<String, String>();
		map.put("provinceName", provinceName);
		map.put("CityName", CityName);
		map.put("RegionName", RegionName);
		
		List <Map> SupplyIdList=manage.getSelectResults(
				"com.ymttest.database.mapping.SupplyChinaShipRouteMapper.selectbyProvince", map);
    	manage.commit();
		return SupplyIdList;
	}
	
	

	public static void main(String args[]) {
	    try {
	    		Logger.debug(new SupplyChinaShipRouteWapper().selectbyProvince("上海","*","*").get(0).get("Id"));
	    		
	    } catch (InterruptedException e) {
	        e.printStackTrace();
	    }
	}
}
